package com.stu.day10.SOLID;

/**
 * 违反里氏替换原则的例子:
 * @author zy
 * @date 2025/2/1 18:22
 */
class Bird {
    public void fly() {
        System.out.println("I am flying");
    }
}

class Penguin extends Bird {
    @Override
    public void fly() {
        // 企鹅不能飞，抛出异常
        throw new UnsupportedOperationException("Penguins can't fly!");
    }
}

